// OLED display simplified driver interface file
#ifndef OLED_SSD1306_H
#define OLED_SSD1306_H

#include <stdint.h>     // Defines several extended integer types and macros

/**
 * @brief Initialize the SSD1306 OLED display.
 *
 * This function initializes the SSD1306 display driver chip with a series of initialization commands.
 *
 * @return Returns IOT_SUCCESS on success, IOT_FAILURE otherwise.
 * @author Maker Studio
 * @license Apache 2.0 
 */
uint32_t OledInit(void);

/**
 * @brief Set the display position.
 *
 * This function sets the cursor position on the OLED display for subsequent drawing operations.
 *
 * @param x X-coordinate in pixels
 * @param y Y-coordinate in pages of 8 pixels (i.e., page start address)
 * @author Maker Studio
 * @license Apache 2.0 
 */
void OledSetPosition(uint8_t x, uint8_t y);

/**
 * @brief Fill the entire screen with a specified byte.
 *
 * This function fills the entire screen area with the provided data byte.
 *
 * @param fillData Byte to fill the screen with
 * @author Maker Studio
 * @license Apache 2.0 
 */
void OledFillScreen(uint8_t fillData);

/**
 * @brief Write a data byte to the OLED.
 *
 * This function writes a single byte of data to the OLED display.
 *
 * @param data Data byte to write
 * @return Returns IOT_SUCCESS on success, IOT_FAILURE otherwise.
 * @author Maker Studio
 * @license Apache 2.0 
 */
uint32_t WriteData(uint8_t data);

// Define font types
typedef enum {
    FONT6x8 = 1,
    FONT8x16
} Font;

/**
 * @brief Display a character on the OLED.
 *
 * This function displays a single character at the specified position using the given font.
 *
 * @param x X-coordinate in pixels
 * @param y Y-coordinate in pages of 8 pixels
 * @param ch Character to display
 * @param font Font library to use
 * @author Maker Studio
 * @license Apache 2.0 
 */
void OledShowChar(uint8_t x, uint8_t y, uint8_t ch, Font font);

/**
 * @brief Display a string on the OLED.
 *
 * This function displays a null-terminated string starting at the specified position using the given font.
 *
 * @param x X-coordinate in pixels
 * @param y Y-coordinate in pages of 8 pixels
 * @param str String to display
 * @param font Font library to use
 * @author Maker Studio
 * @license Apache 2.0 
 */
void OledShowString(uint8_t x, uint8_t y, const char* str, Font font);

#endif // OLED_SSD1306_H
